Prepare for shorter precision (round for reround) mode in a decimal floating-point instruction

ABSTRACT

An instruction is executed in round-for-reround mode wherein the permissible resultant value that is closest to and no greater in magnitude than the infinitely precise result is selected. If the selected value is not exact and the units digit of the selected value is either 0 or 5, then the digit is incremented by one and the selected value is delivered. In all other cases, the selected value is delivered.

FIELD OF THE INVENTION

The present embodiment is related computer systems and, more particularly to rounding floating-point coefficients to a selected precision.

BACKGROUND

U.S. Pat. No. 4,823,260 (to Imel et al.) “Mixed-precision floating-point operations from a single instruction opcode” filed Nov. 12, 1987 and incorporated by reference herein provides for performing mixed precision calculations in the floating-point unit of a microprocessor from a single instruction opcode. 80-bit floating-point registers) may be specified as the source or destination address of a floating-point instruction. When the address range of the destination indicates that a floating-point register is addressed, the result of that operation is not rounded to the precision specified by the instruction but is rounded to extended 80-bit precision and loaded into the floating-point register. When the address range of the source indicates that an FP register is addressed, the data is loaded from the FP register in extended precision, regardless of the precision specified by the instruction. In this way, real and long-real operations can be made to use extended precision numbers without explicitly specifying that in the opcode.

The Intel iAPX 286/20 Numeric Data Processor (NDP) has a floating-point instruction set that supports the IEEE Microprocessor Floating Point Standard P754. The NDP has eight 80-bit floating-point registers which provide a capacity equivalent to forty 16-bit registers. Two 16-bit registers control and report the results of numeric instructions. A control word register defines the rounding, infinity, precision, and error-mask controls required by the IEEE standard. In order to accommodate extended-precision floating-point calculations, the NDP supports 32-bit, 64-bit, and 80-bit real values. The 80-bit real values are used internally by the eight 80-bit floating-point registers for extremely high precision calculations. To implement this arithmetic capability requires a separate opcode for each instruction which specifies a floating-point data type. This results in a number of separate opcodes in order to achieve all possible combinations of floating-point data types. Extra conversion instructions are necessary to convert and round the extended real result to the desired destination format with double rounding. It is desirable to reduce the number of floating-point operations in order to simplify the programming and increase the performance of floating-point operations. The Imel patent provides an apparatus for performing a number of kinds of mixed precision calculations in the floating-point unit of a microprocessor utilizing a single instruction opcode.

U.S. Pat. No. 6,108,772 “Method and apparatus for supporting multiple floating point processing models” filed Jun. 28, 1996 and incorporated by reference herein discloses a numerical processing method on a computer system in which an instruction having at least one operand and a type control is retrieved, and the operand is converted to a precision specified by the type control. The instruction is executed in the precision specified by the type control to obtain a result, and when the destination precision differs from the precision specified by the type control, the result is converted to the destination precision using a second instruction.

A method is needed to permit rounding decimal floating-point (DFP) numbers to a variable precision that results in a precise result.

SUMMARY

DFP operations are performed as if they first produce an intermediate result correct to infinite precision and with unbounded range. The intermediate result is then rounded to the destination's precision according to one of the eight DFP rounding modes. If the rounded result has only one form, it is delivered as the final result; if the rounded result has redundant forms, then an ideal exponent is used to select the form of the final result. Most operations which produce a DFP result have an Ideal exponent defined. The Ideal exponent of an operation determines the form, not the value, of the final result.

An instruction is executed in round-for-reround mode wherein the permissible resultant value that is closest to and no greater in magnitude than the infinitely precise result is selected. If the selected value is not exact and the units digit of the selected value is either 0 or 5, then the digit is incremented by one and the selected value is delivered. In all other cases, the selected value is delivered.

The present embodiment provides for preparing a decimal floating-point BID encoded result of an instruction execution for rounding to a variable precision value. An instruction employing the embodiment executes a round-for-reround mode that detects if the result formed from an intermediate result has a least significant bit value of 0 and that the trailing portion (to be truncated off) has a value greater than 1 and when those conditions are met, a flag is set when the result is exact. Two means are proposed. The first sets the low order bit of the result to 1 such that any subsequent reround to at least 2 fewer decimal digits can be performed because it is guaranteed that the least significant decimal digit is not 0 (however the least significant decimal digit might still be 5 exact or inexact so the reround cannot safely reround to 1 fewer digits).

In another embodiment, a test is performed in the round-for-reround mode for a least significant digit being 0 or 5 and the trailing digits being greater than 0 to set a first flag. If the value of the trailing digits is a half-way-and-above value setting a second flag but. The tag bits are saved in one of a plurality of registers associated with a FPR of a plurality of floating-point registers. In this case the result portion of the intermediate portion is not modified before storing it as a result because the needed information is saved in the tag fields. A subsequent DFP reround instruction uses these flag bits to reround the resulting operand to a variable number of digits less than or equal to the number of digits of the source operand.

It is therefore an object of the embodiment to execute a decimal floating-point instruction (DFP round-for-reround instruction) configured to perform a decimal floating-point operation, the decimal floating-point instruction configured to utilize a round-for-reround mode, the executing step comprising the steps of producing an intermediate result of the executed decimal floating-point operation, the intermediate result having a high order portion and a low order portion, the high order portion corresponding to a hardware format, the hardware format having a first number of digits of precision (decimal coefficient digits of precision) including a least significant digit. Then, rounding the high order portion according to the round-for-reround mode, wherein the rounding step comprises the step of, if the least significant bit of the high order portion is 0 and if the value of the low order portion is greater than 0, changing the least significant bit of said high order portion to 1 to form a to-be-stored high order portion (rounded-for-reround DFP number). If the least significant bit of the high order portion of the intermediate result produced in step 1) is 1, or if the value of the low order portion of said intermediate result produced in step 1) is 0, leaving the least significant digit of said high order portion unchanged to form said to-be-stored high order portion. Then storing the to-be-stored high order portion as a final result of the executed decimal floating-point operation.

It is further an object of the embodiment to, subsequent to execution of the decimal floating-point instruction (DFP round-for-reround instruction), executing a decimal (DFP) reround instruction, the decimal reround instruction configured to round a decimal floating-point number to any of a plurality of rounding precisions, the step of executing the decimal reround instruction execution comprising the steps of fetching the stored final result of the executed decimal floating-point (DFP) operation, the fetched final result having a first number of bits representing a first number of decimal digits. Then determining a decimal reround instruction specified rounding precision of the plurality of rounding precisions, wherein the specified rounding precision employs a second number of digits consisting of two or more fewer digits than the first number of digits. Then rounding the fetched final result to the second number of digits specified by the decimal reround interaction. And storing the rounded final result (rounded result) of the executed decimal floating-point operation as a result of the decimal reround instruction.

The above as well as additional objectives, features, and advantages of the present embodiment will become apparent in the following written description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram depicting components of an example prior art computer system;

FIG. 2 depicts an example network of computer systems according to the prior art;

FIG. 3 is a table depicting a prior art DFP coding scheme;

FIG. 4 is a diagram representing operation of an example round-for-reround instruction;

FIG. 5 depicts an example execution using the round-for-reround mode;

FIG. 6 depicts execution of a reround instruction;

FIG. 7 depicts an embodiment of a round--for-reround instruction employing Floating Point Register tags (pF);

FIG. 8 depicts execution of a reround instruction using the pF tags; and

FIG. 9 depicts a DFP round-for-reround operation.

DESCRIPTION OF PREFERRED EMBODIMENTS

US Patent Publication No. 2006/0047738 A1 (Schwarz et al.) “Decimal rounding mode which preserves data information for further rounding to less precision” filed Aug. 31, 2004, published Mar. 2, 2006 is incorporated by reference herein.

As described in the Patent Publication 20060047738, this system is useful for financial applications run on microprocessor based computer processing systems, and will be seen to be an improvement to the now standard IEEE 754 Floating Point. It can be proved that a system can round to “p” digits of precision a result that was previously rounded to “2p+2” digits of precision without causing double rounding errors. The current IEEE 754 binary floating point standard defines the significands of single, double, and a proposed quadword format such that this criterion is met (24, 53, and 113 bits in each format). Each format is greater than a little over twice the width of the next smaller precision. There has been developed a current IEEE 754 revision developed by a committee which has agreed on decimal floating-point formats of 7, 16. and 34 digits which also satisfy this requirement. When we considered this development we wondered how can a computer system be developed where a user can run applications which round to 10 digits accurately if the original arithmetic operation were rounded to 16 digits. Such an application would now meet the revised requirement, one which does not meet this criterion.

We will describe our improvement with respect to FIG. 9. The first requirement is to create an instruction which rounds to a user specified precision which is variable, which we call the “ReRound” instruction. And the second requirement is that the original arithmetic operation in the higher precision somehow maintains information about the infinitely precise intermediate result. This information is used to prevent incorrect double rounding and enables the hardware to construct an equivalent operand, which when rounded to a smaller precision using the ReRound instruction, produces the same result as if rounding the original infinitely precise operand. Prior methods for maintaining this information about the infinitely precise result have included recording in a status word whether the rounded target is inexact and in a few cases some architectures have also provided a bit indicating whether it was rounded up. This allows rounding of a “p” digit result to a “p−1” or less digits of precision. One other method previously mentioned is to only round to only “((p/2)−1)” where “p” is the precision of the target of an arithmetic operation (i.e. 7, 16 or 34 digits depending on hardware format chosen). Choosing to limit the rounding capabilities to less than half the machine precision is severely limiting. And using the status word to maintain the additional information creates a bottleneck for performance.

An embodiment eliminates the performance bottleneck of updating and reading the floating-point status word of prior applications and provides the capability of secondary roundings up to “p−1” digits of precision where the first rounding was to “p” digits of precision. The mechanism for providing this information is to create a new rounding mode which maintains this information within the result of the first rounded result which was rounded to the hardware format precision. This rounding mode creates a result which will round equivalently to “p−1” digits or less of precision as the original infinitely precise result. By doing this, the extra information is contained completely within the operand and there is no bottleneck in using the floating-point status word. And given that the information is contained within the operand, multiple independent operations can be placed in between these two instructions (the original arithmetic instruction to hardware precision and the subsequent rerounding to lesser precision).

A method of processing data employs a new rounding mode called “round for reround” on the original arithmetic instruction in the hardware precision, and then an instruction which we called the reround instruction is invoked which specifies a variable rounding precision and possibly explicitly sets the rounding mode. The precise result of the arithmetic operation is first truncated to the hardware format precision “p”, forming an intermediate result. If only zeros are dropped during truncation, then the intermediate result is equal to the precise result, and this result is said to be “exact”, otherwise, it is “inexact”. When the intermediate result is inexact and its least significant digit is either zero or five, then that digit is incremented to one or six respectively forming the rounded result. Thus, when the least significant digit of a rounded result is zero or five the result could be construed to be exact or exactly halfway between two machine representations if it were later rounded to one less digit of precision. For all other values, it is obvious that the result is inexact and not halfway between two machine representations for later roundings to fewer than “p” digits of precision. A nice mathematical property of this rounding mode is that results stay ordered and in a hardware implementation it is guaranteed that the incrementation of the least significant digit does not cause a carry into the next digit of the result.

FIG. 9 shows a representation of the preferred embodiment for the “round for reround” mode. Here is a rounding table, where isd denotes the least significant digit in the target format of the intermediate result, ie represents, when one, that it is inexact, and result specifies the action to be taken for setting of the least significant digit of the rounded result. When the least significant digit of the intermediate result (lsd) is any of 1-4 and 6-9, the lsd is set as a least significant digit of the rounded result. When a lsd is any of 0 and 5 and the intermediate result is exact (ie=0), than the lsd is set as a least significant digit of the rounded result. When a lsd is any one of 0 and 5 and the intermediate result is inexact (ie=1) then an incremented lsd is set as the least significant digit of the rounded result. When a lsd is any one of 0 and 5 and the intermediate result is exact (ie=0) then the lsd is set as the least significant digit of the rounded result.

This embodiment could be used by implementations of Decimal Floating-Point format proposed in the next revision to the IEEE 754 Binary floating-Point Standard and implemented in a hardware implementation of this Decimal Floating-Point format. This a robust method of rounding to lesser precision than the hardware format. It removes any dependencies between writing and reading a single point such as the floating-point status word and instead can be implement in systems providing an interlock between writing and reading operands into registers. With this new interlock mechanism the two instructions could he separated in time by any number of independent instructions.

An example of this is our preferred embodiment of a method to multiply two operands in a 16 digit hardware format but later round the answer to 15 digits in rounding mode where the operand is rounded to the nearest representable number in the target format and in case of a tie is rounded to the lower magnitude. One could also call this rounding mode round half down).

This method can be illustrated as follows:

Using Round for Reround Rounding Mode:

employing a decimal multiply intermediate product, say 1.23456789012344560111, and

rounding the decimal multiply intermediate product to 16 digits using our round for reround mode, which in the illustration would yield 1.234567890123446, and then later

applying an instruction reround to 15 digits, which in the illustration yields 1.23456789012345.

It will be noted that if instead the decimal multiply were rounded toward zero the 16 digit result would be 1.234567890123445, and applying the instruction reround to 15 digits would yield 1.23456789012344 which is a wrong result.

So, in accordance with the preferred embodiment, rounding to less digits accurately involves two functions:

-   -   1) using a new rounding mode called “round for reround” on the         original arithmetic instruction in the hardware precision, and         then     -   2) invoking an instruction which specifies a variable rounding         precision and possibly explicitly sets the rounding mode which         we have called the ReRound instruction.

FIG. 1 illustrates a representative workstation or server hardware system in which the present embodiment may be practiced. The system 100 of FIG. 1 comprises a representative computer system 101, such as a personal computer, a workstation or a server, including optional peripheral devices. The workstation 101 includes one or more processors 106 and a bus employed to connect and enable communication between the processor(s) 106 and the other components of the system 101 in accordance with known techniques. The bus connects the processor 106 to memory 105 and long-term storage 107 which can include a hard drive, diskette drive or tape drive for example. The system 101 might also include a user interface adapter, which connects the microprocessor 106 via the bus to one or more interface devices, such as a keyboard 104, mouse 103, a printer/scanner 110 and/or other interface devices, which can be any user interface device, such as a touch sensitive screen, digitized entry pad, etc. The bus also connects a display device 102, such as an LCD screen or monitor, to the microprocessor 106 via a display adapter.

More particularly, machine instructions of the present embodiment can be used with a computer architecture with existing instruction formats. These computer architected instructions comprise computer software, stored in a computer storage medium, for producing the code running of the processor utilizing the computer software, and comprising the instruction code for use by a compiler or emulator/interpreter which is stored in a computer storage medium, and wherein the first part of the instruction code comprises an operation code which specified the operation to be performed and a second part which designates the operands for that participate.

The system 101 may communicate with other computers or networks of computers by way of a network adapter capable of communicating 108 with a network 109. Example network adapters are communications channels, token ring, Ethernet or modems. Alternatively, the workstation 101 may communicate using a wireless interface, such as a CDPD (cellular digital packet data) card. The workstation 101 may he associated with such other computers in a Local Area Network (LAN) or a Wide Area Network (WAN), or the workstation 101 can he a client in a client/server arrangement with another computer, etc. All of these configurations, as well as the appropriate communications hardware and software, are known in the art.

FIG. 2 illustrates a data processing network 200 in which the present embodiment may he practiced. The data processing network 200 may include a plurality of individual networks, such as a wireless network and a wired network, each of which may include a plurality of individual workstations 101 201 202 203 204. Additionally, as those skilled in the art will appreciate, one or more LANs may be included, where a LAN may comprise a plurality of intelligent workstations coupled to a host processor.

Still referring to FIG. 2, the networks may also include mainframe computers or servers, such as a gateway computer (client server 206) or application server (remote server 208 which may access a data repository and may also be accessed directly from a workstation 205). A gateway computer 206 serves as a point of entry into each network 207. A gateway is needed when connecting one networking protocol to another. The gateway 206 may be preferably coupled to another network (the Internet 207 for example) by means of a communications link. The gateway 206 may also be directly coupled to one or more workstations 101 201 202 203 204 using a communications link. The gateway computer may be implemented utilizing an IBM eServer zSeries® 900 Server available from IBM Corp.

Software programming code which embodies the present embodiment is typically accessed by the processor 106 of the system 101 from long-term storage media 107, such as a CD-ROM drive or hard drive. The software programming code may be embodied on any of a variety of known media for use with a data processing system, such as a diskette, hard drive, or CD-ROM. The code may be distributed on such media or may be distributed to users 210 211 from the memory or storage of one computer system over a network to other computer systems for use by users of such other systems.

Alternatively, the programming code 111 may be embodied in the memory 105 and accessed by the processor 106 using the processor bus. Such programming code includes an operating system which controls the function and interaction of the various computer components and one or more application programs 112. Program code is normally paged from dense storage media 107 to high speed memory 105 where it is available for processing by the processor 106. The techniques and methods for embodying software programming code in memory, on physical media, and/or distributing software code via networks are well known and will not be further discussed herein.

The present embodiment may be practiced within a single computer or across a network of cooperating computers.

Floating-point numbers are typically represented in a computer system using a sign, an exponent, and a significand. The significand represents the number of bits of precision of the number. The exponent defines the range of the number and is bounded by the values Emax (maximum exponent) and Emin (minimum exponent). The sign represents the sign of the number, either positive or negative. Using these three fields, floating-point numbers are represented in the form

(−1)^(s)2^(E)(b₀.b₁ b₂ b₃.b_(p−1))

where:

s=the sign bit, 0 or 1

E=the exponent, any integer between Emin and Emax, inclusive

b_(i)=a significand bit, 0 or 1

p=number of significand bits (precision)

.=implied decimal point

A floating-point number has p bits of precision in the significand field, b₀.b₁ b₂ b₃.b_(p−1), which represent the number's significant digits. (The term ‘significand’ is analogous to the term ‘mantissa’ used to describe floating-point numbers on some conventional computers). The exponent field, E, locates the binary point within the significant digits (and therefore determines the number's magnitude). The term ‘exponent’ is analogous to the term ‘characteristic’ used to describe floating-point numbers on some conventional computers. The decimal point is not explicitly stored in the number, although its position is implied. Also, the significand bit b₀ to the left of the decimal point may be implied as well. A 1-bit sign field, s, indicates whether the number is positive or negative. Negative numbers differ from positive numbers only in the sign bits of their significands.

For example, the number −260.00 can be represented as: 1 00001000 00000100000000000000000 where the sign bit is 1 (indicating a negative number), the exponent is 00001000 (8), and the significand is 1.00000100000000000000000, where the leading 1 and decimal point are implicit.

TABLE 2 Single Double Extended Total Format 32 64 80 Width p (bits of precision) 23 53 64 Exponent bits 8 11 15 Emax +127 +1023 +16383 Emin −126 −1022 −16382 Exponent Bias +127 +1023 +16383

TABLE 2 describes the fields of each of three real-number formats; single, double, and extended.

The exponent determines a real number's magnitude. The exponent is typically stored in a biased form. A constant, called the bias, is added to the true exponent of the number to obtain a biased exponent. The bias is different for each real format. The bias is chosen so as to force the biased exponent to be a positive value. A number's true exponent can be determined simply by subtracting the bias value of its format from the exponent.

When a numeric value becomes very close to zero, normalized floating-point storage cannot be used to express the value accurately. A number R is said to be denormal when −2Emin<R. to accommodate denormal numbers, the processor can store and operate on real numbers that are not normalized, i.e., whose significands contain one or more leading zeros. Denormal numbers typically arise when the result of a calculation yields a value that is too small to represent in the destination format.

Denormal values have the following properties:

The biased floating-point exponent is stored at its smallest value. For single precision numbers, this minimum exponent value is −126. For double precision, the minimum exponent value is −1022. For the extended precision format, the minimum exponent value is −16382.

For all formats, when the number is denormal the minimum exponent is encoded with a bit pattern of all zeros.

The integer bit of the significand (whether explicit or implicit) is zero.

Interpretation of the exponent for denormal numbers differs from the interpretation of the exponent encoding for normalized numbers. For denormalized numbers, the exponent is encoded with the bit pattern of all zeros. However, this pattern is interpreted by the processor to have a value which is the minimum exponent value for the format (which is −126 for single format, −1022 for double real format, and −16382 for the extended real format). Hence, interpreting such denormal numbers by merely adding the bias of the format to the exponent encoding of the denormal number will produce an exponent value that is off by one. Denormals and true zeros both have exponents encoded with all zeros, although the interpretation of these encodings differ.

Numeric Computation Rules:

To achieve consistent and reliable results from the computation, certain rules or conventions (relating to the operating precision and range of each computation) must be followed during numeric operations. Rules are defined for handling operands of mixed precision, and for the computation of intermediate values. IEEE standard 754-1985 allows for two important conventions for handling operands with mixed precisions, and for intermediate computations. These will be henceforth referred to as.

“Compute in Extended Precision”

“Compute in Destination Precision”

The detailed computation rules specified in the IEEE standard 754-1985 will not all be repeated here and may be found in the official document. However, a short summary of the distinguishing characteristics is provided below.

Summary of the “Compute in Extended Precision” Convention

Under this convention, all intermediate values are computed to approximately infinite precision (commonly approximated by the extended precision format which must have at least 64 bits of precision) before entering into the final computation of the result. The result is then coerced to the destination format.

For example, consider the numerical operation:

A=B*C+D*E

where A, B, C, D, E are all defined to be double-precision values. Let I1=B*C, let I2=D*E, and let I3=I1+I2

In the above example, all variables B, C, D, and E are first promoted to the extended precision format (no information is lost in promoting a variable to a wider format). Intermediate values I1 and I2 are calculated by performing the multiplications for B*C as well as for D*E in extended precision, so that I1 and I2 contain 64 bits of precision. The sum of I1 and I2 is also computed in extended precision to generate I3. Finally, I3 is coerced to the double precision format by a rounding and precision conversion operation.

This convention is used by the floating-point units and math coprocessors for the x86 family of processors manufactured by INTEL® Corp. The advantage of this convention is that intermediate values are computed with additional precision and range, which enhances the precision, reliability and integrity of the final result. The enhanced range on intermediate values often eliminates overflows and underflows that could have occurred on the intermediate calculations but would not have been significant for the final result.

In an exemplary processor such as those manufactured by Intel Corp, the extended precision format contains 64 bits of precision, and the exponent range is 15 bits. The coercion of the intermediate value I3 from extended precision to the final result in the destination precision is performed by a store instruction, which also saves the final result to memory. This store instruction is complicated by the necessity to not only store the result to memory, but also convert to the destination precision, including rounding of the value and checking for overflow or underflow which may accompany the conversion, and possibly denormalizing the result to the destination format. The hardware for implementing the store instruction requires a rounding circuit, a range-checking and compression circuit, a denormalizer, as well as circuitry for actually transferring the value to memory. Thus, considerable complexities must be incurred on the store path in order to deliver the benefits of computing in a wider precision.

Summary of the “Compute in Destination Precision” Convention:

Under this convention, which is followed by many commercial Reduced Instruction Set (RISC) processors, all intermediate values are computed in the precision of the destination variable, rather than being computed in a wider format.

For example, consider again the numerical operation:

A=B*C+D*E

where A, B, C, D, E are all defined to be double-precision values. Let I1=B*C, and let I2=D*E.

Using this convention, the intermediate results I1 and I2 are computed in double precision. The double-precision final result A is simply computed as I1+I2, without any additional rounding or conversion, because both intermediate values I1 and I2 are also double precision.

The advantage of this convention is that computations are typically faster and require less hardware to implement. Arithmetic involving 64-bit operands (extended) is typically slower than arithmetic involving 53-bit operands (double). Also, since intermediate values are computed in the final destination precision, no additional conversion and rounding operations must be executed to reach the destination precision, further improving the speed of the calculation.

The disadvantage of this method is the lost precision and range on intermediate values. This loss results in an accumulation of round off errors and the potential for additional overflows and underflows during intermediate calculations. Roundoff accumulation leads to a loss of integrity in the final result, and the overflows and underflows (when they occur) lead to reduced performance. Improvements needed

The problem is to perform the arithmetic operation and subsequent rounding as if only one rounding were performed on an infinitely precise intermediate result. Prior art comprised maintaining the intermediate result to infinite precision and performing rounding to the target precision on it. This proved to be prohibitive in terms of hardware to maintain the intermediate result or slow, and there could be very little separation of the arithmetic operation and the rounding step. Another possible method is to use flag bits in the floating-point status word that indicated inexactness and truncating the arithmetic operation followed by a special instruction which looked at the flag bit. This would require no separation of the arithmetic operation from the rounding instruction and required the resetting of the inexact flag which gets set by all arithmetic instructions. An embodiment allows separation of the arithmetic operation from the shorter precision rounding operation without using a bottlenecked register like the floating-point status word. Instead the result of the arithmetic operation in the register file was rounded to make equivalent representation that rounded equivalent to the infinite precise result.

The embodiment is useful for DPD format, which is a BCD like format, but it is not as easy to implement if the format is the INTEL® BID format. Incrementing a result with a 0 or 5 in the least significant digit may result in propagating a carry the whole length of the integer coefficient. Take for instance the number 16777215 base 10 is equal FFFFFF base 16 and when incremented will propagate its whole length. So, in an integer format it is possible that the prior art method may be used but it causes an expense in the rounding requiring a full length incrementation.

For the BID format, to eliminate the need for full propagation of the carry, a different rounding mode is proposed for decimal integer format. The new rounding mode consists of logically ORing a signal indicating the inexactness of the intermediate result with the least significant bit. Though with this rounding mode, rounding is supported efficiently to P−2 digits or less instead of P−1. This new rounding effectively helps perturb a least significant zero digit but does not perturb a least significant digit of 5 in the coefficient, therefore one less digit can be rounded to tell whether there is an exact halfway case between two representations. This new rounding mode can be coupled with a reround instruction which can subsequently round the result of the arithmetic operation to the desired precision as long as it is 2 digits or more less than the hardware precision.

According to the IEEE 754R Floating Point standard DPD format, a set of 3 decimal digits d0:d2 are encoded into a 10 bit format consisting of bits b0:b9. When the value of all 3 decimal digits is less than 8, the decimal digits are encoded in binary form wherein d0 is encoded in b0:2, d1 is encoded in b3:b5 and d2 is encoded in b7-b9. b6 is set to 0 to indicate that all 3 digits are less than 8 and therefore, fit into the 3bit binary forms. When a decimal digit is greater than 7, b6 is set to 1 and various other binary bits (bx) indicate that the corresponding encoding represents the decimal digit values greater than 7. In all cases, b9 is the least significant bit of the third decimal digit encoding. Thus, by setting b9 to 1, it is assured that the value of each corresponding value of the decimal digit is greater than 0. Furthermore, it is assured that any set of 3 decimal representations having a 5 followed by one or more 0's, the set is greater than 50 or 500. For the case where the least significant decimal digit is 5 (wherein b6 is 0), one might set b8 (of b7:b9) to 1 to assure that the resulting decimal digit is greater than 5.

In the IEEE 754R Floating-point standard, Binary Integer Decimal format abbreviated by BID is a format which represents the coefficient as a binary integer rather than using a format based on Binary Coded Decimal (BCD). For 64-bit decimal format with BID encoding, there is a 1-bit sign, 5-bit combination field, an 8-bit exponent continuation field, and a 50-bit coefficient continuation field similar to DPD encoding. There two differences between the BID and DPD encodings: 1) the encoding of the coefficient, and 2) the ordering of the combination and exponent continuation fields which is not detailed. The encoding of the coefficient for BID is a binary integer representation of the 4 coefficient bits extracted from the 5-bit combination field concatenated with the 50-bit coefficient continuation field for a total of 54 bits. Any value of the 54 coefficient bits greater than or equal to 10¹⁶ is treated as a value of zero. DPD encoding of the coefficient continuation field is a compressed BCD format which takes 3 BCD which would normally require 12 bits to represent and encodes them into 10 bits. BID encoding of the coefficient is in binary and DPD encodes the coefficient in a compressed BCD format. Binary is efficient for high-order arithmetic operations while DPD is efficient for extracting digits and converting to and from BCD databases.

Thus, in the DPD format, the least significant bit y of the DPD format is the same as the least significant bit m of the BCD digit that formed the DPD digit. Therefore, if the least significant digit of a BCD number is 0000, the least significant bit of the DPD encoding m is 0. This provides a useful characteristic for the present embodiment. If a DPD format operation is performed such as multiply, an intermediate result is produced. The intermediate result having a high order portion that conforms to a hardware format, and a low order portion. When the result is rounded, only the high order portion is saved. If the least significant decimal digit D (represented as a BCD digit) of the high order portion is 0, it will be necessary to know whether the value V of the low order portion was 0. If V was exactly 0, the high order portion is said to be exact. If the value V of the low order portion is not 0, the high order portion is inexact since one can't tell from the high order portion alone whether the least significant digit exactly represents the value that would have included the low order portion or not. The present embodiment, in a round-for-reround mode of operation, determines if the value V of the low order portion is not zero and if the low order bit p of the least significant BCD digit D in either BCD or DPD format of the high order portion is 0. If both are true, the low order bit p is changed to p′=1 to indicate that the least significant digit is not 0. This indicator permits later rounding to D−2 digits or less. Rounding to D−1 digits would further require an exact/inexact indicator for a least significant digit of 5 which is not necessary for the rounding to D−2 or less.

In the case of a BID encoding, the coefficient is coded as a binary integer. Thus it would be very difficult to provide round for reround to the D−1 digit since in a binary integer, the whole integer would have to be analyzed to determine of the least significant digit D of the high order portion was 5. However, in the BID encoding the least significant bit is directly indicative of if the least significant digit D it represents any even value including a decimal 0. Thus, in BID format the mechanism of setting the least significant bit p of the high order portion to a 1 when the both the least significant bit of the high order portion was 0 and the low order portion was not 0 provides a resultant least significant digit D′ that only has a decimal value of 0 when it is exactly 0. This permits later rerounding to D−2 digits or less.

In an embodiment, the high order portion is pre-rounded according to a pre-round mode, wherein the pre-rounding mode comprises any one of round toward 0, round away from 0, round toward +infinity, round toward −infinity, round to nearest with ties to even, round to nearest with ties toward 0 and round to nearest with ties away from 0.

The present embodiment provides a round-for-reround mode for BID encoding by detecting that the encoded least significant bit p is 0 of the most significant portion of the intermediate result and testing that bits p+1 to n of the least significant portion are not all 0's. When this is the case, the p bit is changed to p′=1 indicating the coefficient is non-exact in the case where the least significant decimal digit of the intermediate result represented by the BID encoding was 0 since the change of p to p′ changes the corresponding least significant digit to a decimal 1.

In one embodiment, the round-for-reround operation is performed after an additional step of pre-rounding to the hardware precision having D decimal digits using a specified pre-rounding mode.

A second alternate to the proposed embodiment is to maintain a register file with additional tag bits. It is common in both PowerPC from IBM Corp. and INTEL implementations to maintain a bit(s) of additional information in storage associated with Floating Point Registers but this information has been limited to special number detection (exponent all zero or all ones, fraction all zero or all ones, NaN, Infinity, Zero, or even the implicit integer coefficient bit). In an embodiment of the present embodiment, 1 or 2 additional bits (pF tags) of information are maintained consisting of preferably an inexact bit e and an indicator g of whether a guard digit would be equal to 5 or more. The inexact bit does not include the guard digit half or more if present. The arithmetic operation is rounded to zero (truncation) to D digits and the D digits are written to the register file with the additional 1 or 2 tag bits. With 2 tag bits a subsequent reround instruction could be designed to accurately round to any rounding mode up to D digits. With 1 tag bit (the inexact tag) the subsequent reround instruction could be designed to accurately round to any rounding mode to D−1 digits, since a prior result cannot be determined to be exactly halfway between two representations. Note that 1 tag bit will accurately round directionally (to plus or minus infinity) to D digits.

The present embodiment includes the concept of:

1) a new rounding mode which logically ORs the sticky bit (representing the value of the least significant portion was greater than 0) to the least significant bit of coefficient coupled with a reround instruction.

2) maintaining 1 inexact tag bit per FPR on arithmetic operations coupled with a reround instruction utilizing the tag bit. The tag bit would preferably be saved in a register associated with the floating-point register (FPR) that stores the resulting decimal floating-point number. Each FPR of the plurality of FPRs would have an associated tag register.

3) maintaining 2 tag bits comprising a guard halfway or above bit, and an inexact bit excluding halfway indication. The tag bits would preferably be saved in a register associated with the floating-point register (FPR) that stores the resulting decimal floating-point number. Each FPR of the plurality of FPRs would have an associated tag register.

All of 1) through 3) are systems to achieve the equivalent of 1 rounding error even though the rounding is first performed to D digits on an arithmetic operation and then is subsequently, but possibly separated in time to allow out of order execution, rounded to a target variable precision which is less than or equal to D digits. These systems are very important in decimal floating-point arithmetic to avoid designing the complexity into every arithmetic instruction to force it to round to variable precision.

The present embodiment can be applied to other floating-point formats, including but not limited to hexadecimal, binary or packed decimal.

Referring to FIG. 4, in an embodiment, a decimal floating-point instruction (DFP round-for-reround instruction) is fetched and executed in a machine implementing a plurality of floating-point registers. The instruction includes an opcode field and register fields for locating DFP operands. The instruction is decoded 402 and the location of operands is determined. Also, the operation is to be performed on the operands, what rounding mode (round-for-reround mode) to use and where to store the result of the operation is also determined by any means known in the art. The execution unit fetches the operands 403 and performs the instruction specified operation 404 on the operands 403, the operation in one embodiment is any one of a Multiply, a fused Multiply-and-Add, a Divide, a Convert to BCD, a Convert from BCD, an Add or a Subtract. The format of the coefficient of the operand is preferable BID but may also be any of DPD, binary, hexadecimal, BCD and the like. As a result of the operation, an intermediate result 401 is formed having n (coefficient) bits representing a decimal coefficient. The intermediate result 401 has a most significant portion of p bits, where the p-th bit is the least significant bit of the most significant portion. The intermediate result 401 further comprising a least significant portion (bits (p+1)−n) which will be discarded (to-be-discarded low order portion).

In one embodiment referring to FIG. 5, the round-for-reround mode forms a to-be-stored result (rounded-for-reround number) 501 consisting of the most significant portion of the intermediate result (high order portion). The to-be-stored result 501 is an encoded value of a decimal result 503 having D decimal digits. The to-be-stored result comprises the value of bit p as a p′ bit except that if 502 the value of the least significant portion was greater than 0 the p′ bit is set to 1.

Referring to FIG. 6, an example embodiment of a decimal reround instruction operation is shown. The instruction comprises an opcode, for determining a target precision for performing the reround operation and a register field for locating a storage location for storing the result. Preferably the storage location is a floating-point register of a plurality of floating-point registers. The instruction is fetched and decoded to determine that it is a reround instruction. The target precision D″ is obtained 602 which is the precision that will be applied to the source operand (for decimal floating point, D is a number of decimal coefficient digits 503 corresponding to the p′ bit encoded value 501 of the operand. The source operand 501 (DFP number) is fetched 603, the source operand 501 being the to-be-stored result (rounded-for-reround number) stored by a previously executed decimal instruction having the round-for-reround mode (DFP round-for-reround instruction). The source operand is then rounded to the precision D″ (where D″ is less than D) specified using a specified rounding mode where the number of bits of the encoded result is the encoded value of the decimal result 605 having D″ digits. This embodiment of the reround instruction applied to a BID or DPD form of decimal floating-point number, must reround the source operand to a decimal precision D″ having at least 2 less decimal digits than the source operand D since there is no indication that the least significant digit is a 5 or not. Since the exact/inexact information is encoded in the operand, intervening instructions not affecting the operand do not affect the use of the subsequent reround instruction.

In another embodiment, referring to FIG. 7, the intermediate result of the decimal instruction is tested as before 502. However, instead of modifying the least significant digit of the to-be-stored result, a flag (pF) is set in a flag register 705 (of a plurality m of flag registers 703) associated with the floating-point register 704 storing the result 501. In the embodiment, there is a flag register 705 associated with each FPR 704 of the plurality m of FPRs 702. In one embodiment, the flag when set indicates that the corresponding result low order bit was 0 and the trailing bits were not all 0's. In another implementation, the flag when set indicates that the low order digit of the result was 0 or 5 having trailing bits all 0's. In another implementation, an additional flag bit indicates if the trailing digits consisted of 5 as the most significant digit indicating a halfway-and-above trailer value.

Referring to FIG. 8, a reround instruction gets a target precision 802 D″ and a rounding mode to be used and gets 801 the source operand 501 previously stored. The reround instruction gets 804 the pF flag. The reround instruction rounds 803 the source operand 501 to the precision D″ according to the obtained 802 rounding mode. The result 601 encoded decimal 805 is saved preferably in a floating-point register. This embodiment of the reround instruction applied to a BID or DPD form of decimal floating-point (DFP) number, can reround the source operand to a decimal precision (decimal coefficient precision) having 1 or more fewer decimal digits than the source operand (if the pF flag indicates the least significant digit of the source operand is 0 or 5 and the least significant portion of the intermediate result was greater than 0).

As described in IBM principles of operation document “Preliminary Decimal-Floating-Point Architecture” SA23-2232-00 published November 2006 and incorporated by reference herein, beginning at page 20-9 a coefficient continuation field of the decimal floating-point data format is encoded using Densely Packed Decimal (DPD). DPD encoding is a compression technique which supports the representation of decimal integers of arbitrary length. Translation operates on three Binary Coded Decimal (BCD) digits at a time compressing the 12 bits into 10 bits with an algorithm that can be applied or reversed using simple Boolean operations. In the following examples, a 3-digit BCD number is represented as (abcd)(efgh)(ijkm), a 10-bit DPD number is represented as (pqr)(stu)(v)(wxy), and the Boolean operations, & (AND), | (OR), and ¬ (NOT) are used.

BCD-to-DPD Translation

The translation from a 3-digit BCD number to a 10-bit DPD can be performed through the following Boolean operations.

-   -   p=(a & f & i)|(a & j)|b     -   q=(a & g & i)|(a & k)|c     -   r=d     -   s=(¬a & e & j)|(f & ¬i)|(¬a & f)|(e & i)     -   t=(¬a & e & k)|(a & i)|g     -   u=h     -   v=a|e|i     -   w=(¬e & j)|(e & i)|a     -   x=(¬a & k)|(a & i)|e     -   y=m

DPD-to-BCD Translation

The translation from a 10-bit DPD to a 3-digit BCD number can be performed through the following Boolean operations.

-   -   a=(¬s & v & w)|(t & v & w & x)|(v & w & ¬x)     -   b=(p & s & x)|(p & ¬w)|(p & ¬v)     -   c=(q & s & x)|(q & ¬w)|(q & ¬v)     -   d=r     -   e=(t & v & ¬w & x)|(s & v & w & x)|(¬t & v & x)     -   f=(p & t & v & w & x)|(s & ¬x)|(s & ¬v)     -   g=(q & t & w)|(t & ¬x)|(t & ¬v)     -   h=u     -   i=(t & v & w & x)|(s & v & w & x)|(v & ¬w & ¬x)     -   j=(p & ¬s & ¬t & w)|(s & v & ¬w & x)|(p & w & & w)|(¬v & w)     -   k=(q & ¬s & ¬t& v & w )|(q & v & w & ¬x)|(t & v & ¬w & x)|(¬v &         x)     -   m=y

Alternatively, the Table shown in FIG. 3 can be used to perform the translation. A combination of five bits in the DPD encoding (leftmost column) vwxst are used to specify a translation to the 3-digit BCD encoding. Dashes (-) in the table are don't cares and can be either one or zero.

In an embodiment, as described in the above-identified publication SA23-2232-00 at page 20-4, there are eight rounding modes, the current DFP rounding mode is specified by the value of three rounding-mode bits in the Floating Point Control (FPC) register.

An M3 field of instruction can specify the rounding mode.

In Round to prepare for shorter precision mode (round-for-reround mode), the permissible resultant value that is closest to and no greater in magnitude than the infinitely precise result is selected. If the selected value is not exact and the units digit of the selected value is either 0 or 5, then the digit is incremented by one and the selected value is delivered. In all other cases, the selected value is delivered.

As described in the above-identified publication SA23-2232-00 beginning at page 19-1, the floating-point control (FPC) register is a 32-bit register that contains mask bits, flag bits, a data exception code, and rounding mode bits An overview of the FPC register is shown in Table 3. Details are shown in Tables 4, 5 and 6. In Table 4, the abbreviations “M” and “SF are based on the terms “interruption mask and status tag”, respectively.

TABLE 4 Byte Bit(s) Name Abbr. 0 0 IEEE-invalid-operation mask IMi 0 1 IEEE-division-by-zero mask IMz 0 2 IEEE-overflow mask IMo 0 3 IEEE-underflow mask IMu 0 4 IEEE-inexact mask IMx 0 5-7 (Unassigned) 0 1 0 IEEE-invalid-operation flag SFi 1 1 IEEE-division-by-zero flag SFz 1 2 IEEE-overflow flag SFo 1 3 IEEE-underflow flag SFu 1 4 IEEE-Inexact flag SFx 1 5-7 (Unassigned) 0 2 0-7 Data-exception code DXC 3 0 (Unassigned) 0 3 1-3 DFP rounding mode DRM 3 4-5 (Unassigned) 0 3 6-7 BFP round mode BRM

TABLE 5 FPC Byte 3 Bits 1-3 DFP Rounding Mode 000 Round to nearest with ties to even 001 Round toward 0 010 Round toward +∞ 011 Round toward −∞ 100 Round to nearest with ties away from 0 101 Round to nearest with ties toward 0 110 Round away from 0 111 Round to prepare for shorter precision

TABLE 6 FPC Byte 3 Bits 6-7 BFP Rounding Mode 00 Round to nearest with ties to even 01 Round toward 0 10 Round toward +∞ 11 Round toward −∞

As further described in publication SA23-2232-00, the FPC register contains five IEEE mask bits and five IEEE tag bits that each correspond to one of the five arithmetic exception conditions that may occur when a binary floating-point (BFP) or DFP instruction is executed. The mask bits, when one, cause an Interruption to occur if an exception condition is recognized. If the mask bit for an exception condition is zero, the recognition of the condition causes the corresponding flag bit to be set to one. Thus, a flag bit indicates whether the corresponding exception condition has been recognized at least once since the program last set the flag bit to zero. The mask bits are ignored, and the flag bits remain unchanged, when arithmetic exceptions are recognized for floating-point-support (FPS) and hexadecimal floating-point (HFP instructions).

As described in the above-identified publication SA23-2232-00 at page 20-4, DFP operations are performed as if they first produce an intermediate result correct to infinite precision and with unbounded range. The intermediate result is then rounded to the destination's precision according to one of the eight DFP rounding modes. If the rounded result has only one form, it is delivered as the final result; if the rounded result has redundant forms, then an ideal exponent is used to select the form of the final result. Most operations which produce a DEP result have an Ideal exponent defined The Ideal exponent of an operation determines the form. not the value, of the final result.

Round to prepare for shorter precision. In this mode, the permissible resultant value that is closest to and no greater in magnitude than the infinitely precise result is selected. If the selected value is not exact and the units digit of the selected value is either 0 or 5, then the digit is incremented by one and the incremented result is delivered. In all other cases, the selected value is delivered. When a value has redundant forms, the units digit is determined by using the form that has the smallest quantum.

Load FP Integer

The LOAD FP INTEGER instruction TABLE 7, having the format shown above, is described in the above-identified publication SA23-2232-00 beginning at page 20-29. As described in that publication, if the second operand is a finite number, and if the exponent is less than zero, the second operand is converted and rounded to an integer value in the same floating-point format, and the result is placed at the first-operand location. If the exponent of the second operand is greater than or equal to zero, the result is set to the value of the second operand. The ideal exponent is the greater value of zero and the exponent of the second operand.

As further described in publication SA23-2232-00, the rounding mode is specified by the modifier in the M₃ field:

-   -   0 According to the current DFP rounding mode     -   1-7 Reserved     -   8 Round to nearest with ties to even     -   9 Round toward 0     -   10 Round toward+∞     -   11 Round toward−∞     -   12 Round to nearest with ties away from 0     -   13 Round to nearest with ties toward 0     -   14 Round away from 0     -   15 Round to prepare for shorter precision (round-for-reround)

When the M₃ field contains zero, rounding is controlled by the current DFP rounding mode specified in the FPC register. When bit 0 of the M₃ field is one, rounding is performed as specified by the modifier, regardless of the current DFP rounding mode. Rounding for modifiers 8-15 is the same as the rounding modes 0-7 (binary 000-111), respectively.

We have shown conceptually how to implement what we have in a preferred embodiment implemented in a computer which can effectively be used in a commercial implementation of computer architected decimal instruction format the instructions are used by programmers, usually today “C” programmers. These instruction formats stored in the storage medium may be executed natively in a z/Architecture IBM Server, or alternatively in machines executing other architectures. They can be emulated in the existing and in future IBM mainframe servers and on other machines of IBM (e.g. pSeries Servers and xSeries Servers). They can be executed in machines running Linux on a wide variety of machines using hardware manufactured by IBM, Intel, AMD, Sun Microsystems and others. Besides execution on that hardware under a z/Architecture, Linux can be used as well as machines which use emulation by Hercules, UMX, FXI or Platform Solutions, where generally execution is in an emulation mode. In emulation mode the specific instruction being emulated is decoded, and a subroutine built to implement the individual instruction, as in a “C” subroutine or driver, or some other method of providing a driver for the specific hardware as is within the skill of those in the art after understanding the description of the preferred embodiment. Various software and hardware emulation patents including, but not limited to U.S. Pat. No. 5,551,013 for a “Multiprocessor for hardware emulation” of Beausoleil et al., and U.S. Pat. No. 6,009,261: Preprocessing of stored target routines for emulating incompatible instructions on a target processor” of Scalzi et al; and U.S. Pat. No. 5,574,873: Decoding guest instruction to directly access emulation routines that emulate the guest instructions, of Davidian et al; U.S. Pat. No. 6,308,255: Symmetrical multiprocessing bus and chipset used for coprocessor support allowing non-native code to run in a system, of Gorishek et al; and U.S. Pat. No. 6,463,582: Dynamic optimizing object code translator for architecture emulation and dynamic optimizing object code translation method of Lethin et al; and U.S. Pat. No. 5,790,825: Method for emulating guest instructions on a host computer through dynamic recompilation of host instructions of Eric Traut; and many others, illustrate the a variety of known ways to achieve emulation of an instruction format architected for a different machine for a target machine available to those skilled in the art, as well as those commercial software techniques used by those referenced above.

These decimal instructions are executed in hardware by a processor or by emulation of said instruction set by software executing on a computer having a different native instruction set.

While the preferred embodiment has been illustrated and described herein, it is to be understood that the embodiment is not limited to the precise construction herein disclosed, and the right is reserved to all changes and modifications Coming within the scope of the embodiment as defined in the appended claims. 

1. A computer implemented method for indicating with any least significant decimal coefficient digit of 0 or 5 that a result of a rounding of a decimal floating-point (DFP) number to a lesser precision in a computer processor is an exact (precise) result, the method comprising: executing, by the computer processor, a DFP round-for-reround instruction in a round-for-reround mode, wherein the DFP round-for-reround instruction is configured to perform a DFP operation on a DFP operand, the executing the DFP round-for-reround instruction comprising: based on being in the round-for-reround mode, forming, by the computer processor, from a decimal coefficient number having a high order portion and a low order portion, an intermediate result from the high order portion, wherein the intermediate result has a least significant decimal coefficient digit; without changing any coefficient digit of the intermediate result, other than the least significant decimal coefficient digit, creating from the intermediate result a rounded-for-reround DFP number, the creating comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and storing in computer processor storage, by the computer processor, the intermediate result as a final result of the executed DFP operation, wherein the intermediate result is the rounded-for-reround DFP number, wherein a final result having a least significant digit of 0 or 5 indicates that the final result is exact and that the low order portion is 0, wherein a final result having a least significant digit of any one of 1, 2, 3, 4, 6, 7, 8 and 9 does not indicate that the final result is exact and does not indicate that the low order portion is
 0. 2. The computer implemented method according to claim 1, the creating further comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having a most significant decimal digit of less than 5, incrementing the least significant digit of the intermediate result.
 3. The computer implemented method according to claim 1, further comprising: subsequent to executing the DFP round-for-reround instruction, executing, by the computer processor, a DFP reround instruction, the executing comprising: rounding, by the computer processor, the rounded-for-reround DFP number to produce a rounded result, the rounded result represents a DFP number having at least 1 fewer decimal coefficient digits of precision than the second number of decimal coefficient digits of precision; and storing in computer processor storage, by the computer processor, the rounded result as a result of the execution of the DFP reround instruction.
 4. (canceled)
 5. The computer implemented method according to claim 1, the executing further comprising determining the round-for-reround mode is enabled based on any one of a round-for-reround value of a first rounding field of a Floating Point Control (FPC) register and a round-for-reround value of a second rounding field of the round-for-reround instruction.
 6. The computer implemented method according to claim 5, the determining that the round-for-reround mode is enabled further comprising using the second rounding field of the round-for-reround instruction to select whether to use the first rounding field or the second rounding field to determine that the round-for-reround mode is enabled.
 7. A computer system for indicating with any least significant decimal coefficient digit of 0 or 5 that a result of a rounding of a decimal floating-point (DFP) number to a lesser precision in a computer processor is an exact (precise) result, the computer system comprising: an instruction fetching unit for fetching instructions to be executed; a floating point arithmetic unit for executing floating point operations for executing fetched floating point instructions; and an operand storage in communication with said floating point arithmetic unit; and a memory communicatively coupled to said computer processor, the computer system configured to perform a method comprising: executing, by the computer processor, a DFP round-for-reround instruction in a round-for-reround mode, wherein the DFP round-for-reround instruction is configured to perform a DFP operation on a DFP operand, the executing the DFP round-for-reround instruction comprising: based on being in the round-for-reround mode, forming, by the computer processor, from a decimal coefficient number having a high order portion and a low order portion, an intermediate result from the high order portion, wherein the intermediate result has a least significant decimal coefficient digit; without changing any coefficient digit of the intermediate result, other than the least significant decimal coefficient digit, creating from the intermediate result a rounded-for-reround DFP number, the creating comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and based on the other low order portion being 0, leaving the least significant coefficient digit of the intermediate result unchanged; and storing in computer processor storage, by the computer processor, the intermediate result as a final result of the executed DFP operation, wherein the intermediate result is the rounded-for-reround DFP number, wherein a final result having a least significant digit of 0 or 5 indicates that the final result is exact and that the low order portion is 0, wherein a final result having a least significant digit of any one of 1, 2, 3, 4, 6, 7, 8 and 9 does not indicate that the final result is exact and does not indicate that the low order portion is
 0. 8. The computer system according to claim 7, the creating further comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having a most significant decimal digit of less than 5, incrementing the least significant digit of the intermediate result.
 9. The computer system according to claim 7, further comprising: subsequent to executing the DFP round-for-reround instruction, executing, by the computer processor, a DFP reround instruction, the executing comprising: rounding, by the computer processor, the rounded-for-reround DFP number to produce a rounded result, the rounded result represents a DFP number having at least 1 fewer decimal coefficient digits of precision than the second number of decimal coefficient digits of precision; and storing in computer processor storage, by the computer processor, the rounded result as a result of the execution of the DFP reround instruction.
 10. (canceled)
 11. (canceled)
 12. The computer system according to claim 7, the executing further comprising determining the round-for-reround mode is enabled based on any one of a round-for-reround value of a first rounding field of a Floating Point Control (FPC) register and a round-for-reround value of a second rounding field of the round-for-reround instruction.
 13. The computer system according to claim 12, the determining that the round-for-reround mode is enabled further comprising using the second rounding field of the round-for-reround instruction to select whether to use the first rounding field or the second rounding field to determine that the round-for-reround mode is enabled.
 14. A computer program product for indicating with any least significant decimal coefficient digit of 0 or 5 that a result of a rounding of a decimal floating-point (DFP) number to a lesser precision in a computer processor is an exact (precise) result, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, wherein the computer readable storage medium is not a transitory signal per se, the program instructions executable by the computer processor to cause the computer processor to perform a method comprising: executing, by the computer processor, a DFP round-for-reround instruction in a round-for-reround mode, wherein the DFP round-for-reround instruction is configured to perform a DFP operation on a DFP operand, the executing the DFP round-for-reround instruction comprising: based on being in the round-for-reround mode, forming, by the computer processor, from a decimal coefficient number having a high order portion and a low order portion, an intermediate result from the high order portion, wherein the intermediate result has a least significant decimal coefficient digit; without changing any coefficient digit of the intermediate result, other than the least significant decimal coefficient digit, creating from the intermediate result a rounded-for-reround DFP number, the creating comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and based on the other low order portion being 0, leaving the least significant coefficient digit of the intermediate result unchanged; and storing in computer processor storage, by the computer processor, the intermediate result as a final result of the executed DFP operation, wherein the intermediate result is the rounded-for-reround DFP number, wherein a final result having a least significant digit of 0 or 5 indicates that the final result is exact and that the low order portion is 0, wherein a final result having a least significant digit of any one of 1, 2, 3, 4, 6, 7, 8 and 9 does not indicate that the final result is exact and does not indicate that the low order portion is
 0. 15. The computer program product of according to claim 14, the creating further comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having a most significant decimal digit of less than 5, incrementing the least significant digit of the intermediate result.
 16. The computer program product according to claim 14, further comprising: subsequent to executing the DFP round-for-reround instruction, executing, by the computer processor, a DFP reround instruction, the executing comprises: rounding, by the computer processor, the rounded-for-reround DFP number to produce a rounded result, the rounded result represents a DFP number having at least 1 fewer decimal coefficient digits of precision than the second number of decimal coefficient digits of precision; and storing in computer processor storage, by the computer processor, the rounded result as a result of the execution of the DFP reround instruction.
 17. (canceled)
 18. (canceled)
 19. The computer program product according to claim 14, the executing further comprising: determining the round-for-reround mode is enabled based on any one of a round-for-reround value of a first rounding field of a Floating Point Control (FPC) register and a round-for-reround value of a second rounding field of the round-for-reround instruction.
 20. The computer program product according to claim 19, the determining that the round-for-reround mode is enabled further comprising using the second rounding field of the round-for-reround instruction to select whether to use the first rounding field or the second rounding field to determine that the round-for-reround mode is enabled.
 21. The computer implemented method according to claim 1, further comprising: executing, by the computer processor, another instance of the DFP round-for-reround instruction in the round-for-reround mode, wherein the other instance of the DFP round-for-reround instruction is configured to perform another DFP operation on another DFP operand, the executing the other instance of the DFP round-for-reround instruction comprising: forming, by the computer processor, from another decimal coefficient number having another high order portion and another low order portion, another intermediate result from the high order portion, wherein the other intermediate result has another least significant decimal coefficient digit; without changing any coefficient digit of the other intermediate result, other than the other least significant decimal coefficient digit, creating from the other intermediate result another rounded-for-reround DFP number, the creating comprising: based on the other low order portion being 0, leaving the other least significant coefficient digit of the other intermediate result unchanged; and storing in computer processor storage, by the computer processor, the other intermediate result as another final result of the executed other DFP operation, wherein the other intermediate result is the other rounded-for-reround DFP number, wherein a final result having a least significant digit of 0 or 5 indicates that the final result is exact and that the low order portion is 0, wherein a final result having a least significant digit of any one of 1, 2, 3, 4, 6, 7, 8 and 9 does not indicate that the final result is exact and does not indicate that the low order portion is
 0. 22. The computer implemented method according to claim 1, the creating further comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having a most significant decimal digit of greater than 5, incrementing the least significant digit of the intermediate result.
 23. The computer system according to claim 7, wherein the creating further comprises: based on the least significant coefficient digit of the intermediate result being 0 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and based on the least significant coefficient digit of the intermediate result being 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result.
 24. The computer program product according to claim 14, wherein the creating further comprising: based on the least significant coefficient digit of the intermediate result being 0 or 5 and based on the low order portion having a most significant decimal digit of greater than 5, incrementing the least significant digit of the intermediate result.
 25. The computer program product according to claim 14, wherein the creating further comprises: based on the least significant coefficient digit of the intermediate result being 0 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result; and based on the least significant coefficient digit of the intermediate result being 5 and based on the low order portion having any value other than 0, incrementing the least significant coefficient digit of the intermediate result. 